<template>
    <div class="conatainer">
        <div class="nav" @click="backPage">
            <i class="el-icon-arrow-left"></i>
            <span>返回</span>
        </div>
        <div class="bill-wrap">
            <div class="order-item" v-for="(item, index) in list" :key="index">
                <div class="order-item-top line-v-center">
                    <p class="order-no">订单编号：{{ item.orderM.order_no }}</p>
                    <p class="order-time">下单时间：{{ item.orderM.create_time }}</p>
                </div>
                <div class="order-goods-wrap line-v-center">
                    <div class="order-goods-con">
                        <div class="order-goods">
                            <div class="order-goods-main">
                                <div class="order-goods-item" v-for="(c_item, c_index) in item.orderM.orderGoods" :key="c_index">
                                    <base-img :src="c_item.goods_image"></base-img>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="order-goods-right line-v-center">
                        <div class="line"></div>
                        <div class="order-goods-right-total">
                            <p class="order-goods-price-total">￥{{ item.expend_money }}</p>
                            <p class="order-goods-num-total">共{{item.orderM.order_total_num}}件</p>
                        </div>
                    </div>
                </div>

                <div class="btn-slot">
                    <!-- <slot></slot> -->
                </div>
            </div>
        </div>
        <pagination-footer :total="total" :page.sync="page" :limit.sync="limits" @pagination="getList"></pagination-footer>
    </div>
</template>

<script>
import PaginationFooter from '@/components/PaginationFooter.vue';
import NoData from '@/components/NoData.vue';
import { userBillRecordList } from '@/api/user';
import BaseImg from '@/components/BaseImg.vue';
export default {
    data() {
        return {
            list: [],
            page: 1,
            limits: 15,
            total: 0,
            billId:''
        };
    },
    components: {
        PaginationFooter,
        NoData,
        BaseImg,
    },
    created(){
        this.billId = this.$route.query.id ? this.$route.query.id : "";
        this.getList()
    },
    methods: {
        getList() {
            const that = this;
            userBillRecordList({
                page: that.page,
                limits: that.limits,
                bill_id:that.billId
            }).then(res => {
                that.loadingPage = false;
                that.showPage = true;
                if (res.code == 0) {
                    that.list = res.data.data;
                    that.total = res.data.total;
                }
            })
        },
        backPage() {
            this.$router.back();
        },
    },
};
</script>
<style>
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    /* background-color: #fff; */
    border-radius: 4px;
}

/* 设置滚动条滑块的颜色和圆角 */
::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 4px;
}

/* 设置滚动条滑块悬停时的样式 */
::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

</style>
<style lang="scss" scoped>
.conatainer {
    padding-bottom: 30px;
}
.nav {
    width: 100%;
    height: 50px;
    background: #ffffff;
    border-radius: 8px;
    line-height: 50px;
    font-size: 14px;
    padding: 0 12px;
    box-sizing: border-box;
    margin-top: 12px;
    cursor: pointer;
}
$supplier-color: #44c082;
.order-item {
    width: 100%;
    height: 195px;
    background: #ffffff;
    border-radius: 8px;
    margin-top: 12px;
    .order-item-top {
        width: 100%;
        height: 44px;
        background: #f3f3f3;
        border-radius: 8px 8px 0px 0px;
        display: flex;
        align-items: center;
        font-size: 14px;
        font-weight: bold;
        padding-left: 24px;
        box-sizing: border-box;
    }
    .order-goods-wrap {
        display: flex;
        justify-content: space-between;
        margin-top: 24px;
        .order-goods-con {
            width: 920px;
            height: 120px;
            .order-goods {
                width: 100%;
                height: 100%;
                white-space: nowrap;
                overflow: hidden;
                overflow-x: scroll;
                .order-goods-main {
                    display: inline-flex;
                    padding-left: 12px;
                }
                .order-goods-item {
                    width: 106px;
                    height: 106px;
                    margin-right: 10px;
                    border-radius: 12px;
                    overflow: hidden;
                    img {
                        width: 100%;
                        height: 100%;
                    }
                }
            }
        }

        .order-goods-right {
            width: 130px;
            font-size: 20px;
            font-family: DIN-BOLD;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            .line {
                width: 6px;
                height: 106px;
                background: linear-gradient(
                    90deg,
                    rgba(255, 255, 255, 0) 0%,
                    #dedbdb 100%
                );
            }
            .order-goods-right-total {
                width: 124px;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
            }
        }
    }
    .order-time {
        margin-left: 55px;
        // color:#999999;
        // padding-top:10rpx;
    }
}
</style>